package classes; 
import java.util.Random;
public class part1 {
	public static final int R = 100;
    public static void main(String[] args)
   {
    	double Pi;
    	int x = 0;
    	int y = 0;
    	int N = 1;
    	int M = 0;
    	if (args.length > 0) {
    	    try {
    	        N = Integer.parseInt(args[0]);
    	    } catch (NumberFormatException e) {
    	        System.err.println("Argument must be an integer");
    	        System.exit(1);
    	    }
    	}
    	 Random randomGenerator = new Random();
         for (int idx = 1; idx <= N; ++idx){
            x = randomGenerator.nextInt(100);
            y = randomGenerator.nextInt(100);
            if (x*x + y*y < R*R) {
        		M++;
        	}
          
         }
         
     	Pi =(double) 4*M/N;
     	System.out.println("The Pi is: " + Double.toString(Pi));
     	System.out.println("Number of Darts Thrown:" + N);
     	System.out.println("Number of Darts Inside Circle is:" + M);

      
    }
  }
